package com.xidian.zhiancloud.controller.lz.warnforecast.basicsset;

import com.xidian.zhiancloud.dto.ResultDTO;
import com.xidian.zhiancloud.enums.GeneralResponseEnums;
import com.xidian.zhiancloud.model.WarnLevelSet;
import com.xidian.zhiancloud.service.warnforecast.basicsset.WarnLevelSetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 预警等级设置
 */

@RestController
@RequestMapping("/warnForecast")
public class WarnLevelSetController {
    @Autowired
    private WarnLevelSetService warnLevelSetService;

    @GetMapping("/getList")
    public ResultDTO getList(@RequestParam(value = "current", required = true) int current,
                             @RequestParam(value = "size", required = true) int size) {
        return ResultDTO.successOf(warnLevelSetService.getList(current, size), GeneralResponseEnums.SUCCESS);
    }

    @PostMapping("/update")
    public ResultDTO update(@RequestBody WarnLevelSet warnLevelSet) {
        warnLevelSetService.update(warnLevelSet);
        return ResultDTO.successOf(GeneralResponseEnums.SUCCESS);
    }

}
